<#include "${ftl_skin}/common/header.ftl">

</head>
<body>

<div class="row ibox float-e-margins">
    <div class="ibox-content">
        <form id="formId"  class="form-horizontal" action="${path.servicePath }/datadict/tnodeadd.do" method="post">

            <input type="hidden" name="tree_type" id="treeType" value="${treeType}" />
            <input type="hidden" name="parent_tree_code" id="parent_tree_code" value="${parentTreeCode}" />
            <input type="hidden" name="node_deep" id="node_deep" value="${nodeDeep}" />

            <input type="hidden" name="is_open" id="is_open" value="1" />

            <div class="form-group">
                <label class="col-xs-2 control-label">父结点</label>

                <div class="col-xs-10">
                    ${pNode.node_name!}
                </div>
            </div>
			
			<div class="form-group">
                <label class="col-xs-2 control-label">字典名称</label>

                <div class="col-xs-10">
                    <input id="dict_name" name="dict_name" class="form-control required" type="text" value="" maxlength="50" />
                </div>
            </div>

            <div class="form-group">
                <label class="col-xs-2 control-label">字典值</label>

                <div class="col-xs-10">
                    <input id="dict_val" name="dict_val" class="form-control required" type="text" value="" maxlength="50" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-2 control-label">描述</label>

                <div class="col-xs-10">
                    <input id="dict_remark" name="dict_remark" class="form-control" type="text" value="" maxlength="50" />
                </div>
            </div>



            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-xs-4 col-xs-offset-2">
                    <button class="btn btn-primary" type="button" onClick="javascript:HFFormSubmit('#formId', submitCallback, null);return false;">保存内容</button>
                    <button class="btn btn-white" type="button" onClick="javascript:closeDialog('');return false;">取消</button>
                </div>
            </div>
        </form>
    </div>
</div>



<#include "${ftl_skin}/common/js.ftl">


<script type="text/javascript">
    $(function(){
        //初始化表单验证
        initHFForm('#formId');
    });


    function submitCallback(msg){
        // alert(JSON.stringify(msg));
        if(msg.state == 0){
            HFToastr("操作成功");


            var json = {};
            json.id = msg.result.treeVO.tree_code;
            json.name = msg.result.treeVO.node_name;
            // json.url = treeNodeArr[i].url;
            json.target = 'treesetiframe';
            json.open = true;

            parent.addNodeCB(msg.result.treeVO.parent_tree_code, json);

            winGo('${path.viewPath}/datadict/tnodeedit.do?TREE_CODE=' + msg.result.treeVO.tree_code);
        }else{
        	HFToastrError("字典值已存在！");
        }
    }


</script>

<#include "${ftl_skin}/common/footer.ftl">